package attendance

import (
	"github.com/flipped-aurora/gin-vue-admin/server/api/v1"
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type SignRouter struct {
}

// InitSignRouter 初始化 签到管理 路由信息
func (s *SignRouter) InitSignRouter(Router *gin.RouterGroup,PublicRouter *gin.RouterGroup) {
	signRouter := Router.Group("sign").Use(middleware.OperationRecord())
	signRouterWithoutRecord := Router.Group("sign")
	signRouterWithoutAuth := PublicRouter.Group("sign")

	var signApi = v1.ApiGroupApp.AttendanceApiGroup.SignApi
	{
		signRouter.POST("createSign", signApi.CreateSign)   // 新建签到管理
		signRouter.DELETE("deleteSign", signApi.DeleteSign) // 删除签到管理
		signRouter.DELETE("deleteSignByIds", signApi.DeleteSignByIds) // 批量删除签到管理
		signRouter.PUT("updateSign", signApi.UpdateSign)    // 更新签到管理
	}
	{
		signRouterWithoutRecord.GET("findSign", signApi.FindSign)        // 根据ID获取签到管理
		signRouterWithoutRecord.GET("getSignList", signApi.GetSignList)  // 获取签到管理列表
	}
	{
	    signRouterWithoutAuth.GET("getSignPublic", signApi.GetSignPublic)  // 获取签到管理列表
	}
}
